package proyecto.domain;

import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.classpath.operations.jsr303.RooUploadedFile;

@RooJavaBean
@RooToString
@RooJpaActiveRecord(finders = { "findDocumentoesByNombreEquals", "findDocumentoesByNombre", "findDocumentoesByNombreLike", "findDocumentoesByTagLike", "findDocumentoesByPropietario" })
public class Documento {

    @NotNull
    @Column(unique = true)
    private String nombre;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date fecha;

    @Lob
    private byte[] image;

    private String contentType;

    @ManyToOne
    private Usuario propietario;

    @ManyToOne
    private Provincia provincia;

    @ManyToOne
    private Sucursal sucursal;

    @ManyToOne
    private Area area;

    @ManyToOne
    private TipoDocumento tipoDocumento;

    @NotNull
    private String descripcion;

    private String Tag;

    @ManyToOne
    private EstadoDocumento EstadoDocumento;
}
